package com.hx.sp;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.netflix.feign.EnableFeignClients;
import org.springframework.cloud.netflix.zuul.filters.RouteLocator;
import org.springframework.context.annotation.Bean;


@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients(basePackages = "com.*")
@EnableCircuitBreaker
public class GatewayApplication {
    public static void main(String[] args) {
        SpringApplication.run(GatewayApplication.class, args);
    }
//
//    @Bean
//    public RouteLocator customRouteLocator(RouteLocatorBuilder builder) {
//        return Routes.locator()
//                .route("test")
//                .uri("http://httpbin.org:80")
//                .predicate(host("**.abc.org").and(path("/image/png")))
//                .addResponseHeader("X-TestHeader", "foobar")
//                .and()
//                .route("test2")
//                .uri("http://httpbin.org:80")
//                .predicate(path("/image/webp"))
//                .add(addResponseHeader("X-AnotherHeader", "baz"))
//                .and()
//                .build();
//    }
}
